import styled from 'styled-components';
import * as React from 'react';
import { Card, Descriptions, Button } from 'antd';
import { clearLocalStorage } from 'utils';

export const AccountSettingView = (props: { category?: string, onClick?: (category: string, item: any) => void }) => {

    return (
        <Container>
            <StyledCard>
                <Descriptions title={''} layout={'horizontal'} column={1}>
                    <Descriptions.Item label="">{'如以后不在使用该软件可以选择注销账户，服务端将清除该账户信息，请慎重注销。'}</Descriptions.Item>
                    <Descriptions.Item label="">
                        <Button type="primary" danger style={{ minWidth: '180px' }} onClick={() => {
                            clearLocalStorage(undefined);
                            window.location.href = `${window.location.origin}/#/login`;
                        }}>注销账户</Button>
                    </Descriptions.Item>
                </Descriptions>
            </StyledCard>
        </Container>
    );
}

export default AccountSettingView;

const Container = styled.div`
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    gap:10px;
    padding:30px;
`;

const StyledCard = styled(Card)`
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
`




